#include "ProcessBar.h"

#define STYLE '='
#define LENGTH 101

const char* lable = "|/-\\";

// v1.0
void ProcessBar()
{
    char bar[LENGTH];
    memset(bar, '\0', sizeof(bar));
    int len = strlen(lable);

    int count = 0;
    while(count <= 100)
    {
        printf("[%-100s][%3d%%]{%c}\r", bar, count, lable[count%len]);
        fflush(stdout);
        bar[count++] = STYLE;
        usleep(20000);
    }
    printf("\n");
}
